// import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import config from './config'
import path from 'path'
import vuejsx from '@vitejs/plugin-vue-jsx'
function resolve (dir: string) {
  return path.join(__dirname, dir)
}
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), vuejsx()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `
        @import "${path.join(__dirname, './src/style/variables.scss')}";
        `
      }
    }
  },
  resolve: {
    alias: {
      '@': resolve('./src')
    }
  },
  server: {
    host: '0.0.0.0',
    port: config.development.port,
    open: true,
    proxy: config.development.proxy,
    cors: true
  }
})
